<template>
  <div class="container">
    <normal-title
      title='退款详情'
      :back="true"
    ></normal-title>
    <div class="tips">您已成功发起退款申请，请耐心等待商家处理</div>
    <div class="slice"></div>
    <div
      class="main"
      v-if="orderInfo!==null"
    >
      <a
        :href="'/pages/detail/main?id='+item.product_id"
        hover-class="none"
        class="card"
        v-for="(item, index) in orderInfo.orderProduct"
        :key="index"
      >
        <img
          class="thumb"
          :src="item.image"
          mode="aspectFit"
        >
        <div class="info">
          <p class="text">{{item.product_name}}</p>
          <div class="spec">规格: {{item.item_no}}</div>
          <div class="row">
            <p class="price"><span class="price-icon">￥</span>{{item.price}}</p>
            <div class="count">X {{item.num}}</div>
          </div>
        </div>
      </a>

      <div class="row between">
        <div class="item-name">退款原因</div>
        <div class="order-num">{{orderInfo.orderRefund.refund_reason}}</div>
      </div>
      <div class="row between start-item">
        <div>
          <div class="item-name">退款金额</div>
          <div>含运费: ￥0.00</div>
        </div>
        <div class="price">
          ￥{{orderInfo.orderRefund.refund_fee}}
        </div>
      </div>
      <div class="row between">
        <div class="item-name">退款编号</div>
        <div class="order-num">{{orderInfo.order_no}}</div>
      </div>
      <div class="row between">
        <div class="item-name">退款时间</div>
        <div class="order-num">{{orderInfo.orderRefund.created_at}}</div>
      </div>
      <div class="row end-item">
        <button
          open-type="contact"
          class="btn"
        >联系客服</button>
      </div>
    </div>
    <bottom-btn/>
  </div>
</template>

<script>
import NormalTitle from '@/components/NormalTitle'
import BottomBtn from '@/components/BottomBtn'
import ProductCard from '@/components/ProductCard'
import { request } from '@/utils'
export default {
  components: {
    NormalTitle,
    ProductCard,
    BottomBtn
  },
  computed: {},
  data () {
    return {
      orderInfo: null
    }
  },
  methods: {
    async getOrderInfo () {
      var orderId = this.$root.$mp.query.order_id
      var res = await request('/v1/order/' + orderId, 'get')
      this.orderInfo = res.data
    }
  },
  mounted () {
    this.getOrderInfo()
  }
}
</script>

<style>
page {
  height: 100%;
}
</style>

<style scoped lang="scss">
button {
  border: none;
  background-color: transparent;
  box-sizing: border-box;
  width: auto;
  padding: 0;
  margin: 0;
  line-height: 0;
}
button::after {
  border: none;
}
.container {
  font-size: 24rpx;
  color: #6d6d6d;
  .slice {
    margin: 25rpx 0;
  }
  .tips {
    color: #d3bc8e;
    text-align: center;
    font-size: 30rpx;
    font-weight: 600;
    line-height: 50rpx;
  }
  .main {
    padding: 0 25rpx;
    .card {
      .row {
        margin: 0;
      }
      font-size: 26rpx;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      height: 200rpx;
      border-bottom: 1rpx solid #f0f0f0;
      .thumb {
        width: 180rpx;
        height: 180rpx;
        border-radius: 15rpx;
        margin-right: 30rpx;
      }
      .info {
        width: 460rpx;
        height: 180rpx;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        // border: 1rpx solid #000;
        .spec {
          font-size: 20rpx;
          color: #747474;
          margin-bottom: 5rpx;
          overflow: hidden;
          text-overflow: ellipsis;
          position: relative;
          bottom: 20rpx;
        }
        .text {
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          height: 75rpx;
          font-size: 600;
          color: #000;
        }
        .row {
          display: flex;
          justify-content: space-between;
          align-items: flex-end;
          height: 35rpx;
          line-height: 26rpx;
          .price {
            color: #b93a39;
            font-size: 36rpx;
            font-weight: 400;
            .price-icon {
              font-size: 24rpx;
              display: inline-block;
            }
          }
          .count {
            font-size: 20rpx;
          }
        }
      }
    }
    .row {
      margin: 45rpx 0;
    }
    .arrow {
      width: 35rpx;
      height: 35rpx;
    }
    .order-num {
      font-size: 32rpx;
    }
    .item-name {
      font-size: 32rpx;
      font-weight: 500;
      color: #000;
    }
    .price {
      color: #b93a39;
      font-weight: 600;
      font-size: 36rpx;
    }
    .btn {
      color: #d9c59d;
      border-radius: 30rpx;
      border: 1rpx solid #d9c59d;
      height: 55rpx;
      line-height: 51rpx;
      padding: 0 20rpx;
      font-size: 30rpx;
      // margin-top: 50rpx;
    }
  }
}
</style>




